package usc.cs.survey;

import android.app.Application;

public class CheckBoxData extends Application {
	
	// temp data for each checkBox and combine them latter
	private char[] tempData = new char [24];
    //The String to save 
    private StringBuffer MonAvailableHrs = new StringBuffer();
    private StringBuffer TueAvailableHrs = new StringBuffer();
    private StringBuffer WedAvailableHrs = new StringBuffer();
    private StringBuffer ThuAvailableHrs = new StringBuffer();
    private StringBuffer FriAvailableHrs = new StringBuffer();
    private StringBuffer SatAvailableHrs = new StringBuffer();
    private StringBuffer SunAvailableHrs = new StringBuffer();
    private StringBuffer TestAvailableHrs = new StringBuffer();

    
	
	public CheckBoxData()
	{
		TestAvailableHrs.append("FFFFFFFFFFFFFFFFFFFFFFFF");//!
	}
	
	public void SetTPData(int index, char val)
	{
		tempData[index] = val;
	}
	
	public char GetTPData(int index)
	{
		return tempData[index];
	}
	
	public char[] GetTPAry()
	{
		return tempData;
	}
	
	public void AppendAvailableHrs(int index, char value)
	{
		switch(index)
		{
			case 0:
				MonAvailableHrs.append(value); break;
			case 1:
				TueAvailableHrs.append(value); break;
			case 2:
				WedAvailableHrs.append(value); break;
			case 3:
				ThuAvailableHrs.append(value); break;
			case 4:
				FriAvailableHrs.append(value); break;
			case 5:
				SatAvailableHrs.append(value); break;
			case 6:
				SunAvailableHrs.append(value); break;
		}
	}	
	
	public StringBuffer GetAvailableHrs(int index)
	{
		switch(index)
		{
			case 0:
				return MonAvailableHrs; 
			case 1:
				return TueAvailableHrs;
			case 2:
				return WedAvailableHrs; 
			case 3:
				return ThuAvailableHrs; 
			case 4:
				return FriAvailableHrs; 
			case 5:
				return SatAvailableHrs; 
			case 6:
				return SunAvailableHrs; 

		}
		return null;
	}			
	
	public void SetTest(int index, char val)
	{
		TestAvailableHrs.setCharAt(index, val);//!

	}
	
	public StringBuffer GetTest()
	{
		return TestAvailableHrs;//!
	}
	
	public void ReplaceTest(String str)
	{
		TestAvailableHrs.replace(0, 23, str);
	}
	


	
}
